<?php

/**
 * Description of backofficeEditAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class backofficeEditAction extends sfAction {

    public function execute($request) {
        $reservation = SqlEngine::getReservations(array('reservation_id' => $request->getParameter('id')));

        $time_array = explode(':', $reservation[0]['time']);
        $this->form = new ReservationBackofficeForm(array(
                            'date' => $reservation[0]['date'],
                            'occasion' => $reservation[0]['occasion'],
                            'person_no' => $reservation[0]['person_no'],
                            'time_hour' => $time_array[0],
                            'time_minute' => $time_array[1],
                            'salutation' => $reservation[0]['salutation'],
                            'name_first' => $reservation[0]['name_first'],
                            'name_last' => $reservation[0]['name_last'],
                            'name_company' => $reservation[0]['name_company'],
                            'address' => $reservation[0]['address'],
                            'phone' => $reservation[0]['phone'],
                            'mobile' => $reservation[0]['mobile'],
                            'email' => $reservation[0]['email'],
                            'menu_id' => $reservation[0]['menu_id'],
                            'comments_internal' => $reservation[0]['comments_internal'],
                            'comments_diet' => $reservation[0]['comments_diet'],
                            'comments_general' => $reservation[0]['comments_general']));
    }
}
